package com.lekang.system.domain;

import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.lekang.common.annotation.Excel;
import com.lekang.common.core.domain.BaseEntity;
import java.util.List;

/**
 * 房间对象 room
 *
 * @author zhihao
 * @date 2025-10-13
 */
public class Room extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID（数据库字段） */
    private Long id;

    /** 房间号（数据库字段） */
    @Excel(name = "房间号")
    private String roomNo;

    /** 房间类型外键（数据库字段） */
    @Excel(name = "房间类型外键")
    private Long roomTypeId;

    /** 楼层编号外键（数据库字段） */
    @Excel(name = "楼层编号外键")
    private Long floorId;

    /** 总床位数（数据库字段） */
    @Excel(name = "总床位数")
    private Long totalBeds;

    /** 入住床位数（数据库字段） */
    @Excel(name = "入住床位数")
    private Long occupiedBeds;

    /** 入住率（数据库字段） */
    @Excel(name = "入住率")
    private BigDecimal occupancyRate;

    /** 逻辑删除（数据库字段） */
    @Excel(name = "逻辑删除")
    private Long isDeleted;

    /** 额外字段1（数据库字段） */
    @Excel(name = "额外字段1")
    private String extraField1;

    /** 额外字段2（数据库字段） */
    @Excel(name = "额外字段2")
    private String extraField2;

    // ===================== 原有内存级关联字段（保留）=====================
    /** 关联：当前房间归属的房型（多对1） */
    private RoomType roomType;

    // ===================== 新增内存级关联字段（无数据库对应字段）=====================
    /** 关联：当前房间下的所有床位（1对多） */
    private List<Bed> bedList;
    // =============================================================================

    // 原有getter/setter（略，保持不变）
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }
    public String getRoomNo() { return roomNo; }
    public void setRoomNo(String roomNo) { this.roomNo = roomNo; }
    public Long getRoomTypeId() { return roomTypeId; }
    public void setRoomTypeId(Long roomTypeId) { this.roomTypeId = roomTypeId; }
    public Long getFloorId() { return floorId; }
    public void setFloorId(Long floorId) { this.floorId = floorId; }
    public Long getTotalBeds() { return totalBeds; }
    public void setTotalBeds(Long totalBeds) { this.totalBeds = totalBeds; }
    public Long getOccupiedBeds() { return occupiedBeds; }
    public void setOccupiedBeds(Long occupiedBeds) { this.occupiedBeds = occupiedBeds; }
    public BigDecimal getOccupancyRate() { return occupancyRate; }
    public void setOccupancyRate(BigDecimal occupancyRate) { this.occupancyRate = occupancyRate; }
    public Long getIsDeleted() { return isDeleted; }
    public void setIsDeleted(Long isDeleted) { this.isDeleted = isDeleted; }
    public String getExtraField1() { return extraField1; }
    public void setExtraField1(String extraField1) { this.extraField1 = extraField1; }
    public String getExtraField2() { return extraField2; }
    public void setExtraField2(String extraField2) { this.extraField2 = extraField2; }

    // ===================== 关联字段的getter/setter =====================
    public RoomType getRoomType() { return roomType; }
    public void setRoomType(RoomType roomType) { this.roomType = roomType; }
    public List<Bed> getBedList() { return bedList; }
    public void setBedList(List<Bed> bedList) { this.bedList = bedList; }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("roomNo", getRoomNo())
                .append("roomTypeId", getRoomTypeId())
                .append("floorId", getFloorId())
                .append("totalBeds", getTotalBeds())
                .append("occupiedBeds", getOccupiedBeds())
                .append("occupancyRate", getOccupancyRate())
                .append("isDeleted", getIsDeleted())
                .append("extraField1", getExtraField1())
                .append("extraField2", getExtraField2())
                .append("roomType", getRoomType())
                .append("bedList", getBedList()) // 补充关联字段打印
                .toString();
    }
}